import request from'@/utils/http.js'


// 获取展示的菜单列表
export const menuListApi=(params)=>{
    return request({
        url:`sys/backend/menu/list`,
        method:"GET",
        params:params,
    })
}

// 添加菜单
export const saveMenuApi=(data)=>{
    return request({
        url:'sys/backend/menu/save',
        method:"POST",
        data:JSON.stringify(data),
    })
}

// 获取单个菜单id
export const menuDetailApi=(id)=>{
    return request({
        url:`sys/backend/menu/${id}/detail`,
        method:"GET",
    })
}

// 修改菜单数据
export const updateMenuApi=(data)=>{
    return request({
        url:`sys/backend/menu/update`,
        method:"PUT",
        data:JSON.stringify(data),
    })
}

// 获取路由信息
export const routerApi = () =>{
    return request({
        url:'sys/backend/menu/routers',
        method:"GET",
    })
}


// 获取全部权限数据树结构
export const menuTreeApi = () =>{
    return request({
        url:'sys/backend/menu/tree',
        method:"GET",
    })
}

// 删除
export const deleteMenuApi = (ids) =>{
    return request({
        url:'sys/backend/menu/delete',
        method:"DELETE",
        data:JSON.stringify(ids)
    })
}